home *** CD-ROM | disk | FTP | other *** search
- Path: classic.iinet.com.au!news
- From: ng@mitswa.com.au (John A Ng)
- Newsgroups: comp.lang.c++
- Subject: Re: Performance: C vs. C++
- Date: Tue, 23 Jan 1996 00:35:30 GMT
- Organization: MITS (WA)
- Message-ID: <4e26je$crd@classic.iinet.com.au>
- References: <30F6BAAC.12B5@iastate.edu>
- NNTP-Posting-Host: grunge205.nv.iinet.net.au
- X-Newsreader: Forte Free Agent 1.0.82
-
- > >>C and C++ are so similar that I would expect similar code to produce
- > >>almost identical performance. However, note that while virtual functions
- > >>cause overhead when you use them, exceptions in most present compilers can
- > >>cause overhead *at every function call*.
- David
-
-
- > >Not quite. C is quite different from C++ from the performance point of
- > >view. The difference is not only in virtual functions and exceptions
- > >but in class construction, destruction, etc... and most significantly in
- > >Runtime Type Checking. However, because machines are getting faster by
- > >the day, this sort of "inefficiency" is hardly noticable.
- John Ng
-
-
- > Not quite. There are no such things as "virtual functions", "exceptions",
- > >"class construction", "destruction" and "Runtime Type Checking" in C.
- > If you use just "C" subset of C++ you will have the same efficiency as
- > for C (no more difference then with different "C" implementations).
- >
- > I would not say if a new tool can do the same (with the same performance) and
- > something new (with some performance) than it has less performance.
- Michael Furman
-
-
- Conceded. If you don't use C++ features in a C++ compiler, there
- should be no difference in performance. Then again, I don't see the
- point in all this talk if we are still talking about using C in a C++
- compiler ? :-)
-
- By the way, it should be "Runtime Type Information" instead of
- "Runtime Type Checking".
- Regards,
-
- John Ng
- ng@mitswa.com.au
- Western Australia
-
-